package com.gym.Thread;

public class Test {
	public static void main(String[] args) {
		MyThread myThread = new MyThread();
		//设置线程名
		myThread.setName("线程一");
		//设置优先级
		myThread.setPriority(1);
		MyThread myThread1 = new MyThread();
		myThread1.setName("线程二");
		//获取当前线程---实现runable接口，在子类中可以使用此方法获取线程名字，
		Thread thread = Thread.currentThread();
		System.err.println(thread.getPriority());
		myThread.start();
		myThread1.start();
		
		
		Thread thread2 = new Thread(new MyRunnable());
		thread2.start();
	}
}
